package com.youle.robots.message;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

/**
 * Created by IntelliJ IDEA.
 * User: kedong
 * Date: 18-3-27
 * Time: 下午3:05
 * To change this template use File | Settings | File and Code Templates ->Includes->File Header.
 *
 * @author kedong
 */
@Component
public class Consumer {

    // 使用JmsListener配置消费者监听的队列，其中text是接收到的消息
    @JmsListener(destination = "test")
    @SendTo("out.queue")
    public void receiveQueue(String text) {
        System.out.println("Consumer收到的报文为:" + text);
    }
}
